package com.chenliang.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
 * @program: bob
 * @description:
 * @author: 陈亮
 * @create: 2022-07-11 21:36
 */

/**
 * org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter.filter  debug93行查询路由真实路径
 */


@SpringBootApplication
@EnableDiscoveryClient

// TODO: 2022/7/11  excludeFilters 是干嘛的? 不加@ComponentScan 一直提示红色波浪线
@ComponentScan(value = {"com.chenliang.gateway"},
        excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE)}) 
public class GatewayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(GatewayApplication.class, args);
        String property = run.getEnvironment().getProperty("a.b");
        System.out.println(property);
    }
}
